<!DOCTYPE HTML>
<html>

	<head>
		<meta charset="UTF-8">
		<title>LingPowerAI</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<script type="text/javascript">
			document.write('<script src="../../js/fix.js?rd=?rd=' + Math.random() + '"><\/script>');
		</script>
		<script type="text/javascript">
			link(['../../css/reset.css', '../../fonts/iconfont/iconfont.css']);
		</script>
		<style type="text/css">
			.mb1rem {
				margin: 0.15rem 0rem;
			}

			.mui-content {
				background: #FFFFFF;
			}

			.body_top {
				height: 2.2rem;
				background: #47BAFE;
				position: relative;

			}

			.body_top .img {
				border-radius: 50%;
				border: 1px solid #FFFFFF;
				overflow: hidden;
				background: #FFFFFF;
				width: 0.85rem;
				height: 0.85rem;
				margin: 0 auto;
				margin-bottom: 0.1rem;
				line-height: 0.85rem;
				display: flex;
				align-items: center;
				justify-content: center;
			}

			#head-img {
				max-width: 100%;
				max-height: 100%;
				vertical-align: middle;
			}

			.body_top p {
				height: 0.3rem;
				line-height: 0.3rem;
				text-align: center;
				margin: 0rem;
				font-size: 0.14rem;
			}

			.body_top #userName {
				font-size: 0.22rem;
				font-weight: 600;
				margin: 5px 0px;
			}

			.cardbox {
				background: #FFFFFF;
				height: 1rem;
				width: 90%;
				margin-left: 5%;
				z-index: 10;
				border-radius: 10px;
				position: absolute;
				bottom: -0.47rem;
				height: 0.95rem;
				box-shadow: 0 2px 10px 0 rgb(150, 210, 245, 0.4), 0 2px 10px 0 rgb(177, 189, 195, 0.4);
			}

			.cardbox .cardLeft {
				display: inline-block;
				font-family: serif;
				width: 60%;
				display: flex;
				text-align: center;
				float: left;
			}

			.cardbox .cardLeft div {
				flex: 1;
			}

			.cardRight a {
				font-size: 0.14rem;
				background: #47BAFE;
				color: #FFFFFF;
				position: absolute;
				right: 0.1rem;
				height: 0.25rem;
				border-radius: 5px;
				line-height: 0.25rem;
				padding: 0rem 0.1rem;
				top: 0.5rem;
			}

			.cardbox .cardRight {
				display: inline-block;
				font-family: serif;
				width: calc(40% - 0.15rem);
				;
				position: relative;
				vertical-align: bottom;
			}

			.cardRight p {
				height: 0.5rem;
				line-height: 0.6rem;
				font-family: serif;
				color: #999999;
				padding-right: 0.5rem;
			}

			.cardRight #ticket_cnt {
				color: #c1c1c1;
				margin: 0rem;
				height: 0.5rem;
				line-height: 0.3rem;
				font-size: 0.22rem;
				font-weight: 600;
			}


			.cardbox .colbox p:first-child {
				height: 0.5rem;
				margin: 0rem;
				color: #999999;
				line-height: 0.6rem;
			}

			.cardbox .colbox p:last-child {
				color: #c1c1c1;
				margin: 0rem;
				height: 0.5rem;
				line-height: 0.3rem;
				font-size: 0.22rem;
				font-weight: 600;
			}

			#userName,
			#userInfo {
				color: #FFFFFF;
			}

			.li_list {
				padding: 0rem 0.2rem;
			}

			.li_list li:active {
				background: #f8f8f8;
			}

			.mui-table-view-cell:after {
				background-color: #eee !important;
			}

			.line {
				height: 0.5rem;
				margin-bottom: 0.2rem;
				width: 0.01rem;
				display: inline-block;
				background: #d6f0ff;
			}

			#buyrell:active {
				background: #9dd9fc;
			}

			#tipsbox {
				background: rgba(26, 26, 26, 0.7);
				color: #FFFFFF;
				padding: 0.05rem;
				border-radius: 0.05rem;
			}

			.mui-table-view-cell:after {
				left: 0.5rem;
			}

			.Myicon {
				color: #47BAFE;
				display: inline-block;
				width: 0.35rem;
				height: 0.45rem;
				transform: translateY(0.02rem);
				font-size: 0.2rem;
				line-height: 0.45rem;
			}

			.mui-table-view-cell a {
				height: 0.45rem;
				line-height: 0.45rem;
			}

			.mui-table-view-cell {
				padding: 0px 0.05rem;
			}

			.mui-table-view-cell>a:not(.mui-btn) {
				margin: 0px;
			}

			.shareImg {
				position: fixed;
				top: 50%;
				left: 50%;
				width: 80%;
				background: #FFFFFF;
				z-index: 25;
				height: 4rem;
				border-radius: 0.05rem;
				background: #47BAFE;
				transform: translateX(-50%) scale(1);
				margin-top: -2.5rem;
				animation: shareimg .8s;
			}

			@keyframes shareimg {
				0% {
					transform: translateX(-50%) scale(0.7);
				}

				25% {
					transform: translateX(-50%) scale(1);
				}

				50% {
					transform: translateX(-50%) scale(0.9);
				}

				75% {
					transform: translateX(-50%) scale(1);
				}

				100% {
					transform: translateX(-50%) scale(1);
				}
			}

			.shareImg .img {
				border-radius: 50%;
				border: 1px solid #FFFFFF;
				overflow: hidden;
				background: #FFFFFF;
				width: 0.8rem;
				height: 0.8rem;
				margin: 0 auto;
				line-height: 0.8rem;
				display: flex;
				align-items: center;
				justify-content: center;
				border: 1px solid #F8F8F8;

			}

			.shareImg .img img {
				max-width: 100%;
				max-height: 100%;
				vertical-align: middle;
			}

			.mask {
				position: fixed;
				top: 0rem;
				left: 0rem;
				width: 100vw;
				background: rgba(0, 0, 0, 0.5);
				height: 100vh;
				z-index: 20;
			}

			.shareImg .name {
				text-align: center;
				font-size: 0.24rem;
				padding: 0.13rem 0rem;
			}

			.shareImg p {
				font-size: 0.14rem;
				text-align: center;
			}

			.codeImg {
				width: 1.8rem;
				margin: 0 auto;
				height: 1.8rem;
				line-height: 1.8rem;
				transform: translateY(-1.2rem);
			}

			.codeImg img {
				max-height: 100%;
				vertical-align: middle;
				max-width: 100%;
			}

			.top {
				padding-top: 0.4rem;
				background: #FFFFFF;
				padding-bottom: 0.7rem;
				/* background-size: 100% 100%; */
			}

			.center {
				height: 0.5rem;
				background: #FFFFFF;
				transform: translateY(-0.2rem);
				border-radius: 0px 0px 50% 50%;
				/* background: rgba(0,0,0,0); */
			}

			.footer {
				background: #47BAFE;
				height: 1.2rem;
				position: relative;
			}

			.closeMask {
				position: absolute;
				right: -0.15rem;
				background: #FFFFFF;
				top: -0.15rem;
				border-radius: 50%;
				height: 0.4rem;
				width: 0.4rem;
				text-align: center;
				line-height: 0.5rem;
				box-shadow: 0 0 3px 0px #cdedff;
			}

			.closeMask span {
				font-size: 0.3rem;
			}

			.sharebtn {
				position: absolute;
				bottom: -0.8rem;
				text-align: center;
				width: 100%;
				text-align: right;
				color: #FFFFFF;
				font-size: 0.16rem;
				height: 0.8rem;
				line-height: 0.8rem;
				font-size: 0.18rem;
				/* background: #FFFFFF; */
				text-align: left;
			}

			.sharebtn img {
				border-radius: 50%;
				width: 0.4rem;
				height: 0.4rem;
				vertical-align: middle;
			}

			.sign_in {
				position: absolute;
				right: 0.4rem;
				top: 0.38rem;
				height: 0.35rem;
				border-radius: 30px;
				background: #FFFFFF;
				color: #47BAFE;
				text-align: center;
				line-height: 0.35rem;
				width: 0.9rem;
				font-weight: bold;
				font-size: 0.15rem;
				box-shadow: 0 0 6px 0px #bbbbbb;
			}

			.sign_in_yes,
			.sign_in_yes i {
				color: #999999;
				font-size: 0.14rem;
			}

			.ShareApp {
				padding: 0rem 0.15rem;
				height: 0.7rem;
			}

			.ShareApp .leftImg {
				display: inline-block;
				vertical-align: middle;
				height: 0.4rem;
				margin-top: 0.05rem;
				margin-right: 0.1rem;
			}

			.ShareApp .leftImg img {
				height: 100%;
			}

			.ShareApp .center_info {
				vertical-align: middle;
				margin-top: 0.15rem;
				display: inline-block;
			}

			.ShareApp .center_info p {
				font-size: 0.13rem;
			}

			.ShareApp .center_info b {
				color: #545454 !important;
				display: block;
				font-size: 0.15rem;
				font-weight: 650;
				padding-top: 0rem;
			}

			.ShareApp .rigth_btn {
				display: inline-block;
				float: right;
				vertical-align: middle;
				margin-top: 0.2rem;
			}

			.ShareApp .rigth_btn a {
				color: #FFFFFF;
				display: inline-block;
				width: 0.8rem;
				height: 0.3rem;
				text-align: center;
				line-height: 0.3rem;
				border-radius: 30px;
				background: #47BAFE;
			}

			#ShareApp:active {
				background: #77cdff;
			}

			.huangguanbox {
				width: 1.4rem;
				position: relative;
				margin: 0 auto;
			}

			/* 	.huangguanbox .img{
				border:1px solid #ffb300;
			} */
			#huangGuan {
				display: none;
				position: absolute;
				top: -0rem;
				right: 0rem;
				transform: rotate(63deg);
				height: 0.35rem;
				width: 0.35rem;
			}
			
			.mask_navBox {
				position: fixed;
				display: none;
				top: 0rem;
				left: 0rem;
				height: 100%;
				width: 100%;
				z-index: 1000;
				background-color: rgba(0, 0, 0, 0.7);
			}
			
			
			.mask_navBox .text {
				margin: 0.15rem 0.15rem;
				font-size: 0.2rem;
				color: #FFFFFF;
				line-height: 0.33rem;
			}	
			.mask_navBox .btn {
				display: block;
				width: 1.2rem;
				float: right;
				border-radius: 10px;
				color: #FFFFFF;
				margin-right: 0.2rem;
				font-size: 0.22rem;
				height: 0.4rem;
				line-height: 0.4rem;
				box-sizing: content-box;
				text-align: center;
				border: 0.03rem solid #FFFFFF;
			}
			.mask_nav .img{
				text-align: right;
				padding-right: 0.3rem;
			}
			.mask_nav .img img{
				border-radius: 5px;
				width: 0.7rem;
				margin-top: 32vh;
				vertical-align: middle;
			}
			.mask_nav .jiantou{
				margin: 0 auto;
				display: block;
				height: 1.5rem;
				transform: rotate(-10deg);
			}
			.mask_navBox .text {
				margin: 0.15rem 0.15rem;
				font-size: 0.2rem;
				color: #FFFFFF;
				line-height: 0.33rem;
			}
			.mask_navBox .yaoQing{
               display: block;
			   text-align: right;
   			}
			.mask_navBox .yaoQing img{
				margin-right: 0.15rem;
				width: 0.9rem;
				border-radius: 30px;
			}
		</style>
	</head>

	<body>
		<div class="mask" id="mask" style="display: none;"></div>

		<header class="mui-bar mui-bar-nav">
			<!-- <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a> -->
			<!-- <h1 class="mui-title">我的</h1> -->
			<a id="MyDataEdit" class="mui-icon mui-icon-gear mui-pull-right">
			</a>
		</header>
		<div class="mask_navBox" id="mask_navBox" >
			<div class="mask_nav" id="mask_nav1">
				<div class="img" alt="">
					<img src="../../images/mask_nav/buy.png">
				</div>
				<img src="../../images/mask_nav/jiantou.png" class="jiantou">
				<div class="text">
					1. 点击「购买」按钮，可以
					<span style="color: #ee630e;">购买灵豹券或年卡</span>
				</div>
				<a href="javascript:;" class="btn" onclick="mask_nav(1)">下一步</a>
			</div>
			<div class="mask_nav" id="mask_nav2"  style="display: none;">
				<div class="text" style="margin-top: 30%;">
					2. 点击「去邀请」按钮，转发邀请码。朋友下载注册后，您可
					<span style="color: #ee630e;">获赠灵豹券</span>
				</div>
				<div style="height: 2.4rem;">
					<img src="../../images/mask_nav/jiantou2.png" class="jiantou" style="transform: rotate(-50deg);margin-top: 1rem;height: 1.7rem;">
				</div>
					<div class="yaoQing">
						<img src="../../images/mask_nav/yaoQing.png" >
					</div>
					<a href="javascript:;" class="btn" onclick="mask_nav(2)" style="margin: 0 auto !important;float: inherit;">知道了</a>
			</div>
		</div>
		
		<div class="shareImg" style="display: none;" id="shareImg">
			<div class="closeMask" id="closeMask">
				<span class="mui-icon mui-icon-closeempty"></span>
			</div>
			<div class="top">
				<div class="img"><img src="../../images/default_pick_photo.png" id="myhead" alt=""></div>
				<div class="name" id="myname">还没有填写名字</div>
				<p style="font-size: 0.16rem;">我的邀请码：<span id="codenumber">空</span></p>
			</div>
			<div class="center">
			</div>
			<div class="footer">
				<div class="codeImg">
					<img src="../../images/mine/mycode.png" alt="">
				</div>
				<!-- <p style="text-align: center; color: #FFFFFF;transform: translateY(-0.8rem);">扫码或长按识别二维码</p> -->
				<div class="sharebtn">
					分享：<img onclick="goshare(1)" src="../../images/mine/wechat.png" alt="">&nbsp;&nbsp;<img onclick="goshare(2)" src="../../images/mine/wechatFriends.png"
					 alt="">
				</div>
			</div>
		</div>
		<div class="mui-content mui-scroll-wrapper" id="pullrefresh">

			<div class="body_top">
				<div style="position: relative;">
					<div class="huangguanbox">
						<img id="huangGuan" src="../../images/mine/huangGuan.png" alt="">
						<div class="img" id="head-img-box">
							<img id="head-img" src="../../images/default_pick_photo.png">
						</div>
					</div>
					<span id="sign_in" class="sign_in"><i class="iconfont iconqiandao-">&nbsp;</i><span>签到</span></span>
				</div>
				<p id="userName"><b>未登录</b></p>
				<p id="userInfo" class="mui-ellipsis">主人太懒了，简介什么的都没有写...</p>
				<div class="cardbox">
					<div class="cardLeft">
						<div class="colbox importCutomer">
							<p>已导入客户</p>
							<p id="client_cnt">0</p>
						</div>
						<div class="colbox makeCustomer">
							<p>已成交单</p>
							<p id="prouduct_cnt">0</p>
						</div>
					</div>
					<span class="line"></span>
					<div class="colbox  cardRight">
						<p>灵豹劵<i id="tips" class="mui-icon mui-icon-help" style="font-size: 0.23rem; font-weight: bold;color: #47BAFE;position: absolute;top:0.18rem;margin-left: 0.05rem;"></i></p>
						<p id="ticket_cnt">0</p>
						<a href="javascript:;" id="buyrell">购买</a>
					</div>
					<div id="tipsbox" style="display: none;">
						您可以针对重点客户使用灵豹劵，以获得更全面、更精准的分析。每张劵仅限对一名客户使用。
					</div>
				</div>

			</div>
			<div style="height: 0.4rem;"></div>

			<ul class="li_list" style="margin-bottom: 0rem;">
				<li class="mui-table-view-cell mui-collapse-content">
					<a id="order_record" class="mui-navigate-right"><span style="font-size: 0.22rem;" class="Myicon iconfont iconjilu"></span>订单记录</a>
				</li>
				<li class="mui-table-view-cell mui-collapse-content">
					<a id="contractUs" class="mui-navigate-right "><span class="Myicon iconfont iconlianxiwomen1"></span>联系我们 </a>
				</li>

				<li class="mui-table-view-cell mui-collapse-content">
					<a id="aboutUs" class="mui-navigate-right"><span class="Myicon mui-icon iconfont icongongsi"></span>关于我们</a>
				</li>

				<li class="mui-table-view-cell mui-collapse-content">
					<a id="updateApp" class="mui-navigate-right"><span style="font-size: 0.19rem;" class="Myicon  iconfont iconbanbengengxin1"></span>版本更新</a>
				</li>
			</ul>

		</div>
		<ul class="mui-table-view mb1rem tblv-nl">
			<li class="ShareApp">
				<div class="leftImg"><img src="../../images/mine/yaoqinghy.png" alt=""></div>
				<div class="center_info">
					<b>邀请朋友</b>

					<p>邀请朋友下载，免费获得<span id="lbjcout"></span>张灵豹劵</p>
				</div>
				<div class="rigth_btn">
					<a href="javascript:;" id="ShareApp">去邀请</a>
				</div>
			</li>
		</ul>
		<ul class="mui-table-view mb1rem tblv-nl">
			<li class="mui-table-view-cell">
				<a id="loginOut1" style="text-align: center;">退出登录</a>
			</li>
		</ul>
		<script type="text/javascript">
			//必须顺序加载
			script();
		</script>
		<script type="text/javascript">
			mui.init({
				pullRefresh: {
					container: '#pullrefresh',
					down: { //下拉刷新
						callback: pulldownRefresh,
						style: mui.os.android ? "circle" : "default"
						//auto: true
					}
				},
				beforeback: function() {
					appPage.closeLogin();
				}
			});

			function getProfile() {
				storage.init();
				storageUser = kidstorageuser.getInstance();
				document.getElementById("codenumber").innerText = storageUser.refer_code;
				request("/cmdb/getProfileBySalesId/", {
					sales_id: storageUser.UId
				}, function(data) {
					// alert(JSON.stringify(data));
					document.getElementById("client_cnt").innerText = data.DATASET.client_cnt;
					document.getElementById("prouduct_cnt").innerText = data.DATASET.product_cnt;
					document.getElementById("ticket_cnt").innerText = data.DATASET.ticket_cnt;
					// alert(JSON.stringify(data));
				})
			}
			function mask_nav(index){
				let val=parseInt(index);
				switch (val){
					case 1:
					document.getElementById("mask_nav1").style.display="none";
					document.getElementById("mask_nav2").style.display="block";
						break;
					case 2:
					document.getElementById("mask_nav2").style.display="none";
					document.getElementById("mask_navBox").style.display="none";
						break;
					default:
						break;
				}
			}
			
			var ws = null,
				wc = null;
			let price;
			let yearcard_desc;
			let yearcard_cnt;
			let yearcard_price;
			let edate;
			mui.plusReady(function() {
				let isLoadMine=localStorage.getItem("isLoadMine");
				if(isLoadMine!="yes"){
					document.getElementById("mask_navBox").style.display="block";
				}
				localStorage.setItem("isLoadMine","yes");
				updateSerivces();
				storage.init();
				storageUser = kidstorageuser.getInstance();
				request("/cmdb/queryTicketInfo/", {
					pay_type: "WX",
					sales_id: storageUser.UId
				}, function(r) {
					let time = r.DATASET[0].expire_date.trim();
					edate = time;
					let nowTime = new Date();
					let date = new Date(time);
					if (time != "" && time != null && date > nowTime) {
						document.getElementById("huangGuan").style.display = "block";
						document.getElementById("head-img-box").style.border = "1px solid #ffb300";
					}
					price = r.DATASET[0].price;
					yearcard_desc = r.DATASET[0].yearcard_desc;
					yearcard_cnt = r.DATASET[0].yearcard_cnt;
					yearcard_price = r.DATASET[0].yearcard_price;
					document.getElementById("lbjcout").innerText = r.DATASET[0].share_ticket;
				})
				isSign_in();
				plus.webview.currentWebview().setStyle({
					height: document.documentElement.clientHeight || document.body.clientHeight
				});
				getProfile();
				if (storageUser.IsLogin) {
					document.getElementById("loginOut1").addEventListener("tap", function() {
						var btnArray = ['否', '是'];
						mui.confirm('退出后您将不能查看个人数据，确定退出？', '', btnArray, function(e) {
							if (e.index == 1) {
								//appUI.showWaiting();
								storageUser.loginOut(); //退出
								plus.storage.clear();
								localStorage.removeItem('customerData');

								plus.oauth.getServices(function(services) {
									for (var i in services) {
										var service = services[i];
										log("我是" + service.id)
										if (service.id == "weixin") {
											log(service.id)
											//								var isInstalled = plusIsInstalled(service.id);
											//								if(isInstalled) {
											service.logout(function(e) {
												log("注销成功")
											}, function(e) {
												log("注销失败")
											});
											//}

										}
									}
								});
								//log("关闭了")
								//appUI.closeWaiting();
								// openNew("../login/login.html")

							}
						})

					});
				}


				//每个10秒获取一次消息统计数据
				// setInterval(function() {
				// 	checkMsg();
				// }, 10000);

				document.getElementById("userName").innerText = storageUser.NickName;
				document.getElementById("myname").innerText = storageUser.NickName;
				if (storageUser.Signature != "") {
					document.getElementById("userInfo").innerText = storageUser.Signature;
				}
				if (storageUser.ImgUrl != "") {
					// alert(storageUser.ImgUrl);
					var filename = storageUser.ImgUrl.substring(storageUser.ImgUrl.lastIndexOf("/") + 1, storageUser.ImgUrl.length);
					var relativePath = "_doc/headimg/" + filename;
					//判断本地是否存在此图片
					plus.io.resolveLocalFileSystemURL(relativePath, function(entry) {
						//存在就直接设置图片src
						var sd_path = plus.io.convertLocalFileSystemURL(relativePath);
						document.getElementById("myhead").setAttribute("src", sd_path);
						document.getElementById("head-img").setAttribute("src", sd_path);
						//转成手机绝对路径
					}, function(e) {
						document.getElementById("myhead").setAttribute("src", storageUser.ImgUrl);
						document.getElementById("head-img").setAttribute("src", storageUser.ImgUrl);
					})

				}
				document.getElementById("MyDataEdit").addEventListener("tap", function() {
					mui.openWindow({
						url: 'myInfo.html',
						id: 'myInfo.html',
						extras: {
							sales_id: storageUser.UId
						},
						show: {
							autoShow: true, //页面loaded事件发生后自动显示，默认为true
							aniShow: "pop-in", //页面显示动画，默认为”slide-in-right“；
							duration: 250 //页面动画持续时间，Android平台默认100毫秒，iOS平台默认200毫秒；
						},
						styles: {
							titleNView: {
								autoBackButton: true,
								backgroundcolor: "#47BAFE",
								titleText: "个人信息",
								titlecolor: "white",
							},

						},
						waiting: {
							autoShow: false
						}
					});
					// openNew("myInfo.html",{
					//  sales_id:storageUser.UId
					// })
				})
				document.addEventListener("refreshPage2", function(e) {
					var filename = e.detail.img.substring(e.detail.img.lastIndexOf("/") + 1, e.detail.img.length);
					var relativePath = "_doc/headimg/" + filename;
					//判断本地是否存在此图片
					let url = e.detail.img;
					plus.io.resolveLocalFileSystemURL(relativePath, function(entry) {
						//存在就直接设置图片src
						// alert("存在");
						// var sd_path = plus.io.convertLocalFileSystemURL(relativePath);  //转成手机绝对路径
					}, function(e) { //不存在就下载到本地
						// alert("不存在");
						plus.downloader.createDownload(url, { //下载文件
							filename: "_doc/headimg/"
						}, function(d, status) {
							if (status == 200) {
								// alert("下载成功");
								// alert(d.filename);
								// var sd_path = plus.io.convertLocalFileSystemURL(d.filename);
							} else {
								// alert("下载失败");
								if (d.filename != null) {
									plus.io.resolveLocalFileSystemURL(d.filename, function(entry) {
										entry.remove(function(entry) {
											console.log("文件删除成功==" + d.filename);
										}, function(e) {
											console.log("文件删除失败=" + d.filename);
										});
									});
								}
							}
						}).start();
					});
					pulldownRefresh();

				});
				document.addEventListener("refreshPage", function() {
					pulldownRefresh();

				});

				document.getElementById("tips").addEventListener("tap", function() {
					document.getElementById("tipsbox").style.display = "block";
				})
				document.body.addEventListener("touchstart", function() {
					document.getElementById("tipsbox").style.display = "none";
				})
				// document.getElementById("mySetting").addEventListener("tap", function(){
				// 	openNew("mySetting.html");
				// });
				document.getElementById("aboutUs").addEventListener("tap", function() {
					mui.openWindow({
						url: 'aboutApp.html',
						id: 'aboutApp.html',
						show: {
							autoShow: true, //页面loaded事件发生后自动显示，默认为true
							aniShow: "pop-in", //页面显示动画，默认为”slide-in-right“；
							duration: 250 //页面动画持续时间，Android平台默认100毫秒，iOS平台默认200毫秒；
						},
						styles: {
							titleNView: {
								autoBackButton: true,
								backgroundcolor: "#47BAFE",
								titleText: "关于APP",
								titlecolor: "white",
							},

						},
						waiting: {
							autoShow: false
						}
					});
					// openNew("aboutApp.html");
				});
				document.getElementById("contractUs").addEventListener("tap", function() {
					if (mui.os.plus) {
						plus.device.dial("13585571775");
					} else {
						location.href = "tel:13585571775";
					}
				});
				document.getElementById("updateApp").addEventListener("tap", function() {
					// openNew("mySetting.html");
					plus.nativeUI.showWaiting("正在获取新版信息...");
					setTimeout(function() {
						plus.nativeUI.closeWaiting();
						mui.alert("恭喜您,已经是最新版本了!");
					}, 2000);
				});

				ws = plus.webview.currentWebview();
				document.getElementById("ShareApp").addEventListener("tap", function() {
					setTimeout(function() {
						document.getElementById("shareImg").style.display = "block";
						document.getElementById("mask").style.display = "block";
					}, 50);
				})
				document.getElementById("closeMask").addEventListener("tap", function() {
					document.getElementById("shareImg").style.display = "none";
					document.getElementById("mask").style.display = "none";
				})
				document.getElementById("mask").addEventListener("tap", function() {
					document.getElementById("shareImg").style.display = "none";
					document.getElementById("mask").style.display = "none";
				})

				function isSign_in() { //查询今天是否签到
					let isSign_in = false;
					request("/cmdb/queryLoginHisBySalesID/", {
						sales_id: storageUser.UId
					}, function(r) {
						let sign_inObj = document.getElementById("sign_in");
						if (r.ERROR_MESSAGE.trim() == "已签到") {
							sign_inObj.classList.add("sign_in_yes");
							sign_inObj.children[1].innerHTML = "已签到"
						} else {
							sign_inObj.addEventListener("tap", sign_in, false)
						}

					})

				}

				function sign_in() { //签到
					request("/cmdb/insertLoginHisBySalesID/", {
						sales_id: storageUser.UId
					}, function(r) {
						if (r.ERROR_CODE == "SUCCESS") {
							let sign_inObj = document.getElementById("sign_in");
							mui.toast(r.ERROR_MESSAGE);
							sign_inObj.removeEventListener("tap", sign_in, false)
							sign_inObj.classList.add("sign_in_yes");
							sign_inObj.children[1].innerHTML = "已签到"
						}
					})
				}
				document.addEventListener("shareinfo", function(e) {
					let type = e.detail.type;
					let wxshare = {
						"title": "微信好友",
						"extra": {
							scene: "WXSceneSession"
						}
					};
					if (type == 2) {
						wxshare = {
							"title": "微信朋友圈",
							"extra": {
								scene: "WXSceneTimeline"
							}
						};
					} else if (type == 3) {
						wxshare = {
							"title": "微信收藏",
							"extra": {
								scene: "WXSceneFavorite"
							}
						};
					}
					var msg = {
						pictures: [e.detail.url]
					};
					sweixin ? share(sweixin, msg, wxshare) : plus.nativeUI.alert('当前环境不支持微信分享操作!');
				})

				function updateSerivces() {
					plus.share.getServices(function(s) {
						shares = {};
						for (var i in s) {
							var t = s[i];
							shares[t.id] = t;
						}
						sweixin = shares['weixin'];
					}, function(e) {
						outSet('获取分享服务列表失败：' + e.message);
					});
				}
			});

			function share(srv, msg, button) {
				// outSet('分享操作：');
				if (!srv) {
					// outLine('无效的分享服务！');
					return;
				}
				button && (msg.extra = button.extra);
				// 发送分享
				if (srv.authenticated) {
					// outLine('---已授权---');
					doShare(srv, msg);
				} else {
					// outLine('---未授权---');
					srv.authorize(function() {
						doShare(srv, msg);
					}, function(e) {
						// outLine('认证授权失败：'+JSON.stringify(e));
					});
				}
			}
			// 发送分享
			function doShare(srv, msg) {
				// outLine(JSON.stringify(msg));
				srv.send(msg, function() {
					// document.getElementById("backbtn").style.opacity="1";
					// outLine('分享到"'+srv.description+'"成功！');
				}, function(e) {
					// outLine('分享到"'+srv.description+'"失败: '+JSON.stringify(e));
				});
			}
			// 解除授权
			function cancelAuth() {
				// outSet('解除授权：');
				if (sweixin) {
					if (sweixin.authenticated) {
						// outLine('取消"'+sweixin.description+'"');
					}
					sweixin.forbid();
				} else {
					// outLine('当前环境不支持微信分享操作!');
				}
			}


			//下拉刷新具体业务实现
			function pulldownRefresh() {
				getProfile();
				storage.init();
				storageUser = kidstorageuser.getInstance();
				document.getElementById("userName").innerText = storageUser.NickName;
				document.getElementById("myname").innerText = storageUser.NickName;
				if (storageUser.Signature != "") {
					document.getElementById("userInfo").innerText = storageUser.Signature;
				} else {
					document.getElementById("userInfo").innerText = "主人太懒了，简介什么的都没有写...";
				}
				if (storageUser.ImgUrl != "") {
					// alert(storageUser.ImgUrl);
					var filename = storageUser.ImgUrl.substring(storageUser.ImgUrl.lastIndexOf("/") + 1, storageUser.ImgUrl.length);
					var relativePath = "_doc/headimg/" + filename;
					//判断本地是否存在此图片
					plus.io.resolveLocalFileSystemURL(relativePath, function(entry) {
						//存在就直接设置图片src
						var sd_path = plus.io.convertLocalFileSystemURL(relativePath);
						document.getElementById("myhead").setAttribute("src", sd_path);
						document.getElementById("head-img").setAttribute("src", sd_path);
						//转成手机绝对路径
					}, function(e) {
						document.getElementById("myhead").setAttribute("src", storageUser.ImgUrl);
						document.getElementById("head-img").setAttribute("src", storageUser.ImgUrl);
					})

				}
				// checkMsg();
				// plus.webview.getWebviewById("mine/mine.html").reload();

				mui('#pullrefresh').pullRefresh().endPulldownToRefresh();
			}
			document.getElementById("buyrell").addEventListener("tap", function() {
				mui.openWindow({
					url: "byRell.html",
					id: "byRell.html",
					extras: {
						price: price,
						yearcard_desc: yearcard_desc,
						yearcard_cnt: yearcard_cnt,
						yearcard_price: yearcard_price,
						edate: edate
					},
					show: {
						autoShow: true, //页面loaded事件发生后自动显示，默认为true
						aniShow: "pop-in", //页面显示动画，默认为”slide-in-right“；
						duration: 250 //页面动画持续时间，Android平台默认100毫秒，iOS平台默认200毫秒；
					},
					styles: {
						titleNView: {
							autoBackButton: true,
							backgroundcolor: "#47BAFE",
							titleText: "购买灵豹劵",
							titlecolor: "white",
						},

					},
					waiting: {
						autoShow: false
					}
				});

			})
			document.getElementById("order_record").addEventListener("tap", function() {
				mui.openWindow({
					url: 'order_record.html',
					id: 'order_record.html',
					extras: {
						sales_id: storageUser.UId
					},
					show: {
						autoShow: true, //页面loaded事件发生后自动显示，默认为true
						aniShow: "pop-in", //页面显示动画，默认为”slide-in-right“；
						duration: 250 //页面动画持续时间，Android平台默认100毫秒，iOS平台默认200毫秒；
					},
					styles: {
						titleNView: {
							autoBackButton: true,
							backgroundcolor: "#47BAFE",
							titleText: "订单记录",
							titlecolor: "white",
						},

					},
					waiting: {
						autoShow: false
					}
				});
			})

			// function checkMsg() {
			// 	if (storageUser.UId != "") {
			// 		requestJsonFile("../../data/mine/userMessage.json", {id : storageUser.UId}, function(data) {
			// 			// request("/Player/getPlayerNoReadNotify", {playerid: storageUser.UId}, function(data) {
			// 			if (data[SysConstants.ERROR_CODE_KEY] == SysConstants.ERROR_CODE_OBJECT.ERROR_CODE_SUCCESS) {
			// 				document.getElementById("messageCountSpan").setAttribute("class", "mui-badge");
			// 				document.getElementById("messageCountSpan").innerText = data[SysConstants.DATASET_KEY];
			// 			} else {
			// 				document.getElementById("messageCountSpan").setAttribute("class", "");
			// 				document.getElementById("messageCountSpan").innerText = "";
			// 			}
			// 		}, false, function() {}, false);
			// 	}
			// }
			function goshare(type) {
				let img = document.getElementById("myhead").getAttribute("src");
				if (storageUser.ImgUrl != "") {
					img = storageUser.ImgUrl;
				}
				let name = document.getElementById("myname").innerText;
				let code = document.getElementById("codenumber").innerText;
				let ss = plus.webview.create("shareApp.html", "shareApp.html", {}, {
					img: img,
					name: name,
					code: code,
					type: type
				});
				// ss.show();
				copy_fun("邀请码：" + document.getElementById("codenumber").innerText, "已复制邀请码，可在分享时粘贴输入");
				setTimeout(function() {
					document.getElementById("shareImg").style.display = "none";
					document.getElementById("mask").style.display = "none";
				}, 300);

			}
		</script>
	</body>

</html>
